Added projection test cases for $slice#235
Conversation
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage, test-framework); effort from diff stats (1167+1 LOC, 11 files); LLM: Adds new projection test cases for the $slice operator under the compatibility tests path, expanding test coverage for an existing feature. If a label is wrong, remove it manually and ping |
252a670 to
e7c58b1
Compare
Signed-off-by: Victor Tsang <vitsangp@amazon.com>
9970183 to
d3d27f8
Compare
|
rebased and addressed review's comments |
| "view_restriction", | ||
| projection={"arr": {"$slice": 1}}, | ||
| doc=[{"_id": 1, "arr": [1, 2, 3]}], | ||
| expected=[{"_id": 1, "arr": [1]}], |
|
|
||
| NON_ARRAY_FIELD_TESTS: list[ProjectionTestCase] = [ | ||
| ProjectionTestCase( | ||
| "field_is_null", |
There was a problem hiding this comment.
🟡 Minor — duplicate cases in NON_ARRAY_FIELD_TESTS (test_slice_single_value.py:132-189)
- field_is_null (line 134) and null_vs_missing_null (line 176) assert the same thing — $slice on a null
field returns null. The only difference is an unrelated extra field in the second doc. - field_missing (line 141) and null_vs_missing_absent (line 183) likewise duplicate — both assert that
an absent field stays omitted.
This PR contains:
Ref: